package com.ruoyi.stock2.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.stock2.mapper.STOCKMapper;
import com.ruoyi.stock2.domain.STOCK;
import com.ruoyi.stock2.service.ISTOCKService;
import com.ruoyi.common.core.text.Convert;

/**
 * 股票信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2019-10-21
 */
@Service
public class STOCKServiceImpl implements ISTOCKService 
{
    @Autowired(required = false)
    private STOCKMapper sTOCKMapper;

    /**
     * 查询股票信息
     * 
     * @param symbol 股票信息ID
     * @return 股票信息
     */
    @Override
    public STOCK selectSTOCKById(String symbol)
    {
        return sTOCKMapper.selectSTOCKById(symbol);
    }

    /**
     * 查询股票信息列表
     * 
     * @param sTOCK 股票信息
     * @return 股票信息
     */
    @Override
    public List<STOCK> selectSTOCKList(STOCK sTOCK)
    {
        return sTOCKMapper.selectSTOCKList(sTOCK);
    }

    /**
     * 新增股票信息
     * 
     * @param sTOCK 股票信息
     * @return 结果
     */
    @Override
    public int insertSTOCK(STOCK sTOCK)
    {
        return sTOCKMapper.insertSTOCK(sTOCK);
    }

    /**
     * 修改股票信息
     * 
     * @param sTOCK 股票信息
     * @return 结果
     */
    @Override
    public int updateSTOCK(STOCK sTOCK)
    {
        return sTOCKMapper.updateSTOCK(sTOCK);
    }

    /**
     * 删除股票信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSTOCKByIds(String ids)
    {
        return sTOCKMapper.deleteSTOCKByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除股票信息信息
     * 
     * @param symbol 股票信息ID
     * @return 结果
     */
    public int deleteSTOCKById(String symbol)
    {
        return sTOCKMapper.deleteSTOCKById(symbol);
    }
}
